package com.jd.platform.gobrs.common.model;


import java.io.Serializable;
import java.util.concurrent.atomic.LongAdder;

/**
 * @program: gobrs
 * @ClassName KeyTrafficDto
 * @description:
 * @author: sizegang
 * @create: 2022-01-16 01:42
 * @Version 1.0
 **/
public class KeyTraffic implements Serializable, Comparable<KeyTraffic> {

    private String id;
    private Long size;
    private Long hits;
    private LongAdder hit = new LongAdder();

    private String key;
    private String app;
    private Long time;


    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getHits() {
        return hits;
    }

    public void setHits(Long hits) {
        this.hits = hits;
    }


    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    @Override
    public int compareTo(KeyTraffic o) {
        return (int) (getHits() - o.getHits());
    }

    public LongAdder getHit() {
        return hit;
    }

    public void setHit(LongAdder hit) {
        this.hit = hit;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
